feat(M6b): [] keepArray postfix + quoted-string step selector + trailing-; blocks#19
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…fixes) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lector
i=1 in the path-handler string→name conversion; unblocks descendent-operator
case003/005 and quoted-selectors case002 (+3 official). Obscure ("x").y
paren-literal-head edge accepted (parser collapses the parens).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
M6b is the parser-syntax half of the M6 split — the
[]keepArray postfix plus two isolated parser fixes.[]keepArray — a trailing[]forces a path's final result to stay an array (suppresses the length-1 singleton unwrap). Faithful any-step rule: any step carrying[](incl. a nested predicated sub-path) keeps the path's final result an array — e.g.Phone[type="mobile"][].number→["077 7700 1234"](the[]is onPhone, before.number). Implemented as a recursivepath_keeps_arrayscan feeding the single path-branchfinalize_sequence; every other finalize caller is untouched, so the singleton-unwrap default is byte-identical..(and in first position) selects the named field (foo."bar"≡foo.bar), while a standalone/predicated string ("Red"[$$="Bus"]) stays a literal. Position-based, matching jsonata.;in a block —( a; b; )is now tolerated.Results
flattening(+9, incl. the deferred case041 which passes for free),quoted-selectors,object-constructor,hof-map,transform,descendent-operator, and ~10 more groups.Verification
Plan-grounding against the official cases caught a bug in the draft design (case037 disproved a "last-step" framing → corrected to the faithful any-step rule). An adversarial fidelity review vs the jsonata-js v2.2.1 oracle confirmed A-4 fully faithful,
*[]/**[]match, and a 24-path regression sweep is clean; it found one A-2 gap (first-position quoted strings) fixed inef953c3(which unblocked 3 more cases).Deferred/pre-existing (out of scope): the empty-array-vs-empty-object adapter ambiguity (
$type([])→"object", afrom_luaJSON-input limitation); the obscure("x").yparenthesized-literal-head edge.Test Plan
bustedfull unit suite — 464/464scripts/run-suite.sh— 1211/1682, zero regressions🤖 Generated with Claude Code